//
// Created by francklinson on 2021/11/18 AT 10:28.
// May Saint Diana bless you!
//

#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#include <functional>
#include <climits>
#include <string>

using namespace std;

class Solution {
public:
    int findCenter(vector<vector<int>> &edges) {
        // 只要统计任意两个连线的公共端点
//        if (edges[1][0] == edges[0][0] || edges[1][0] == edges[0][1])
//            return edges[1][0];
//        else
//            return edges[1][1];
        return (edges[1][0] == edges[0][0] || edges[1][0] == edges[0][1]) ? edges[1][0] : edges[1][1];
    }
};

int main() {
    Solution solution;
    vector<vector<int>> edges{{1, 2},
                              {2, 3},
                              {4, 2}};
    cout << solution.findCenter(edges) << endl;
    return 0;
}

